package com.dahouzi.web.article;

import javax.annotation.security.PermitAll;
import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dahouzi.commom.Feedback;
import com.dahouzi.dao.entity.TComment;
import com.dahouzi.service.TArticleService;

@Controller
@PermitAll
@RequestMapping("/CommentCtrl")
public class CommentCtrl {

	@Autowired
	private TArticleService tArticleService;

	/**
	 *
	 * @author 空空dream
	 * @date 2017年10月7日
	 */
	@RequestMapping(value = "/articleComment", method = RequestMethod.PUT)
	public  @ResponseBody Feedback articleComment(@Valid TComment comment) {
		if (comment.insert()) {
			return Feedback.success(Feedback.MSG_SAVE_ERROR, comment);
		} else {
			return Feedback.error(Feedback.MSG_SAVE_ERROR, comment);
		}

	}

}
